Repository navigation
navmap_tools: buildings from the Catastro / OpenStreetMap, and large NavMaps of a place - #45
Open
jmguerreroh wants to merge 2 commits into
Open
jmguerreroh wants to merge 2 commits into
jmguerreroh wants to merge 2 commits into
Conversation
…NavMaps of a place
navmap_gis_tool:
- --buildings {auto,catastro,osm}: downloads the footprints of the buildings (the Catastro
INSPIRE WFS in Spain, by tiles, retried with backoff, split in four when the service keeps
failing and, where it still fails on the building parts, asked for the whole buildings;
OpenStreetMap through Overpass elsewhere or where the Catastro has none) and leaves without ground every
cell any part of a building is in; patios stay ground. Answers are cached on disk.
- --navmap-out FILE: the local height grid as a NavMap, two NavCels per cell with ground,
without the cells that have none (--buildings, --dem-holes-mesh) or are steeper than
--max-slope-deg; vertex colours with --dem-imagery. Vectorised (tens of millions of cells),
unlike --navmap, whose sampling loop is pure Python.
- --dem-holes-mesh now also works with --navmap-out.
jmguerreroh
force-pushed
the
navmap-tools-buildings
branch
from
November 17, 2026 14:16
004fc8a to
45bd828
Compare
… a point (or the largest) A NavMap made from a terrain mesh with its buildings keeps their flat roofs as islands, cut off by the walls the slope limit leaves out; closed patios are islands too. --navmap-keep X,Y keeps the NavCels connected to that point (the nearest cell with ground), --navmap-keep largest the largest part. The parts are found on the grid by a vectorised union-find (16 M cells in about 2 s).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
navmap_tools: buildings from the Catastro / OpenStreetMap, and large NavMaps of a place
Branch base:
rolling. Files:navmap_toolsonly (and its section of the README). Independent ofthe
navmap_coresimplify PR; neither needs the other.What it takes to get a NavMap of a real city: the ground from a DEM, without the buildings, at a
size the Python
--navmapsampling cannot reach (2 x 2 km around the Puerta del Sol at 0.5 m is16 M cells and 13.8 M NavCels).
navmap_gis_tool
--buildings {auto,catastro,osm}(geo/buildings.py): the footprints of the buildings, andevery cell any part of a building is in left without ground (patios stay ground).
catastro: the Spanish Catastro's INSPIRE WFS (BU:BuildingPartwith floors above theground; underground parts are left out), asked by tiles of 800 m. A tile the service keeps
failing on is retried with backoff and asked in four (twice); where it still answers an error
page for the building parts (it happens in some places of Madrid), the whole buildings
(
BU:Building) are asked instead: the footprints, without the floors.osm: OpenStreetMap through Overpass (building=*, exceptno,roofandcarport, whichare no obstacle at ground level).
auto: the Catastro in Spain, OpenStreetMap elsewhere or where the Catastro has none.--cache-dir).--navmap-out FILE(geo/dem_navmap.py): the local height grid as a NavMap, two NavCels percell with ground, without the cells that have none (
--buildings,--dem-holes-mesh) or aresteeper than
--max-slope-deg; vertex colours with--dem-imagery. Vectorised: the 13.8 MNavCels above take 6 min (most of it the download) and 3 GB.
--dem-holes-meshalso works with--navmap-out.--navmap-keep {X,Y|largest}: only the NavCels connected to a point (metres in the localframe of
--center, e.g. where the robot starts; the nearest cell with ground is taken), orthe largest connected part. A NavMap made from a terrain mesh with its buildings keeps their
flat roofs as islands, cut off by the walls the slope limit leaves out; closed patios are
islands too. In the area world of 500 x 500 m around the Puerta del Sol, the 2 289 parts
(55 % of the area roofs) become the one the robot is on. Vectorised union-find on the grid:
16 M cells in about 2 s.
Tests
New tests for the footprints (cells inside a
building, its edges, its patios, footprints beyond the grid), the Catastro answer in the local
frame (underground parts left out), the OpenStreetMap fallback, the whole-buildings fallback, the
DEM-to-NavMap conversion (holes, slopes, colours, the connected parts against a flood fill, the
part at a point or the largest) and the CLI options (a roof left out by
--navmap-keep). No network involved: theanswers are canned.
colcon test --packages-select navmap_toolson this branch: 595 tests (with the linters), nofailures.